<template>
<view class="container">
    <view>
        <rich-text :nodes="articleData.content"></rich-text>
    </view>
</view>
</template>

<script>
var t = require("../../utils/request.js"),
    e = function (t) {
  return t && t.__esModule ? t : {
    default: t
  };
}(require("../../utils/api.js")),
    a = require("../../utils/util.js"),
    i = (getApp(), e.default.articleDetail);

export default {
  data() {
    return {
      articleId: "",
      articleData: null
    };
  },

  components: {},
  props: {},
  onLoad: function (t) {
    t.id && (this.setData({
      articleId: t.id
    }), this.getArticle());
  },
  onReady: function () {},
  onShow: function () {},
  onHide: function () {},
  onUnload: function () {},
  onPullDownRefresh: function () {},
  onReachBottom: function () {},
  onShareAppMessage: function () {
    return {
      title: "让公益更生活 让生活更公益",
      path: "/pages/index/index",
      imageUrl: "/static/images/zyh_logo.jpg"
    };
  },
  methods: {
    getArticle: function () {
      var e = this,
          n = {
        url: i,
        data: {
          id: this.articleId
        }
      };
      (0, t.request)(n, "uncommon", !0).then(function (t) {
        if (t.data.errCode === a.ERR_OK) {
          var i = t.data.data;
          i.createTime = (0, a.formatTimeTwo)(1e3 * i.create_time, "Y-M-D h:m:s"), i.title && uni.setNavigationBarTitle({
            title: i.title
          }), e.setData({
            articleData: i
          });
        } else uni.showToast({
          icon: "none",
          title: t.data.message,
          success: function () {
            uni.navigateBack();
          }
        });
      }).catch(function (t) {
        console.log(t);
      });
    }
  }
};
</script>
<style>
.container {
    padding: 30rpx;
    background: #fff;
}

.title {
    text-align: center;
    font-size: 28rpx;
    font-weight: 600;
}

.auth,.create_time {
    line-height: 56rpx;
    font-size: 24rpx;
    color: #555;
    text-align: right;
}
</style>